<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'flash-ads-form',
    'enableClientValidation' => true,
    'htmlOptions' => array(
        'enctype' => 'multipart/form-data'
    ),
    'action' => array('/ad/flashads/create'),
    'type' => 'horizontal'
))
?>
<?php echo $form->errorSummary($model) ?>
<div>
    <label>Link</label>
<?php echo $form->textField($model, 'url') ?>
<?php echo $form->error($model, 'url') ?>
</div>
<br/>
<div>
    <label>Flash</label>
<?php echo CHtml::activeFileField($model, 'photo') ?>
<?php echo $form->error($model, 'image') ?>
    <?php
    if ($model->image != '')
        echo '<img src="' . Yii::app()->baseUrl . '/uploads/' . $model->image . '" alt="image"/>'
        ?>
    <?php echo $form->hiddenField($model, 'image') ?>
</div>
<br/>
<div>
    <label>Select location</label>
<?php
echo $form->dropDownList($model, 'position', array(
    'right' => 'Right sidebar',
    'left' => 'Left sidebar',
    'bottom' => 'Bottom',
    'top' => 'Top'
))
?>
</div>

<br/>
<div>
    <input type="submit" value="Submit" />

</div>



<?php $this->endWidget() ?>